﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="tin-tuc-noi-bat.ascx.cs" Inherits="UserControl_tin_tuc_noi_bat" %>

<!--Slide-->
<div id="featured">
    <ul class="ui-tabs-nav">
        <%try
            {
                var dtTinChuY = clsTinTuc.TinTuc_FND(basConst.CURENT_PAGE, 4, "", "", "", 1, 1, 0).Tables[0];
                for (int i = 0; i < dtTinChuY.Rows.Count; i++)
                {

                    string ClassSelect = "";


                    string chuy1_TI_ID = dtTinChuY.Rows[i]["TI_ID"].ToString().ToLower();
                    string chuy1_ti_tieude = dtTinChuY.Rows[i]["ti_tieude"].ToString();
                    string chuy1_ti_tieudekhongdau = dtTinChuY.Rows[i]["ti_tieudekhongdau"].ToString();
                    string chuy1_ti_tomtat = dtTinChuY.Rows[i]["ti_tomtat"].ToString();
                    string chuy1_ti_ngaydangtin = dtTinChuY.Rows[i]["ti_ngaydangtin"].ToString();
                    string chuy1_noidung = dtTinChuY.Rows[i]["ti_noidung"].ToString();

                    var lstLinks = OsPortal.oRegexHelper.getlstImageInContent(chuy1_noidung);
                    string strImg = "";
                    if (lstLinks.Count > 0)
                    {
                        strImg = lstLinks[0];
                    }

                    if (i == 0)
                    {
                        ClassSelect = "ui-tabs-selected";
                    }
        %>
        <li class="ui-tabs-nav-item <%=ClassSelect%>" id="nav-<%=chuy1_TI_ID %>"><a href="#<%=chuy1_TI_ID %>">
            <img src="<%=strImg%>" alt="" width="80" height="50" /><span><%=chuy1_ti_tieude %></span></a></li>

        <%}
}
            catch (Exception ex)
            {
                OsPortal.oFileHelper.WriteLogErr("Index.aspx", "GetTinNoiBat", ex.ToString());
            } %>
    </ul>

    <!-- First Content -->
    <%try
        {
            var dtTinChuY = clsTinTuc.TinTuc_FND(basConst.CURENT_PAGE, 4, "", "", "", 1, 1, 0).Tables[0];
            for (int i = 0; i < dtTinChuY.Rows.Count; i++)
            {

                string ClassSelect = "";


                string chuy1_TI_ID = dtTinChuY.Rows[i]["TI_ID"].ToString().ToLower();
                string chuy1_ti_tieude = dtTinChuY.Rows[i]["ti_tieude"].ToString();
                string chuy1_ti_tieudekhongdau = dtTinChuY.Rows[i]["ti_tieudekhongdau"].ToString();
                string chuy1_ti_tomtat = dtTinChuY.Rows[i]["ti_tomtat"].ToString();
                string chuy1_ti_ngaydangtin = dtTinChuY.Rows[i]["ti_ngaydangtin"].ToString();
                string chuy1_noidung = dtTinChuY.Rows[i]["ti_noidung"].ToString();

                var title = OsPortal.oStringHelper.CatChuoi(chuy1_ti_tieude, 50);
                var description = OsPortal.oStringHelper.CatChuoi(chuy1_ti_tomtat, 70);
                var lstLinks = OsPortal.oRegexHelper.getlstImageInContent(chuy1_noidung);
                string strImg = "";
                if (lstLinks.Count > 0)
                {
                    strImg = lstLinks[0];
                }

                if (i == 0)
                {
                    ClassSelect = "ui-tabs-selected";
                }
    %>
    <div id="<%=chuy1_TI_ID %>" class="ui-tabs-panel" style="">
        <img src="<%=strImg%>" alt="" width="450" height="250" />
        <div class="info">
            <h2><a href="/tin-tuc/<%=chuy1_ti_tieudekhongdau%>-<%=chuy1_TI_ID%>"><%=title %></a></h2>
            <p><%=description %><a href="<%=chuy1_ti_tieudekhongdau%>-<%=chuy1_TI_ID%>-xem-tin.html">Đọc tiếp</a></p>
        </div>
    </div>
    <%}
}
        catch (Exception ex)
        {
            OsPortal.oFileHelper.WriteLogErr("Index.aspx", "GetTinNoiBat", ex.ToString());
        } %>
</div>
<!--End slide-->
<script src="/Scripts/jquery-ui-1.9.0.custom.min.js"></script>
<script src="/Scripts/jquery-ui-tabs-rotate.js"></script>
<script type="text/javascript">
        $(document).ready(function () {            $("#featured").tabs({ fx: { opacity: "toggle" } }).tabs("rotate", 5000, true);
        });</script>
